package com.wjk.kylin.mall.order.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TopicRabbitConfig {

    @Bean
    public TopicExchange exchange() {
        return new TopicExchange("demo.topic.exchange");
    }

    @Bean
    public Queue demoQueue() {
        return new Queue("demo.queue");
    }

    @Bean
    public Binding bindingExchangeMessage() {
        return BindingBuilder.bind(demoQueue()).to(exchange()).with("demo.routing");
    }
}
